package com.chunxiadong.service.impl;

import com.chunxiadong.entity.LoginAdmin;
import com.chunxiadong.entity.User;
import com.chunxiadong.mapper.AdminMapper;
import com.chunxiadong.service.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @auther QiuShangcheng
 * @create 2021/6/6
 */
@Service
public class AdminServiceImpl implements AdminService {
    @Autowired
    AdminMapper adminMapper;

    @Transactional
    @Override
    public LoginAdmin queryAdminByName(String name) {
        return adminMapper.queryAdminByName(name);
    }

    @Transactional
    @Override
    public User getAdmin(String nickname) {
        return adminMapper.getAdmin(nickname);
    }

    @Transactional
    @Override
    public User getAdminById(Integer id) {
        return adminMapper.getAdminById(id);
    }
}
